package com.shangxian.giveithome.code;


import lombok.Getter;

@Getter
public enum ApiCode implements Code {

    LOGIN_ERROR(false, 405, "请登录"),
    AUTH_ERROR(false, 403, "您无权作此操作");

    private boolean success;

    private Integer code;

    private String message;

    ApiCode(boolean success, Integer code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    @Override
    public boolean success() {
        return this.success;
    }

    @Override
    public int code() {
        return this.code;
    }

    @Override
    public String message() {
        return this.message;
    }
}
